home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Shareware / Programare / sharp / wwwSharp_setup.exe / {app} / Examples / Data access / MasterDetails / index.hta < prev    next >
Text File  |  2003-12-17  |  4KB  |  137 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4.     <TITLE>wwwSharp.ClrHost master-details example</TITLE>
  5.     <META name="GENERATOR" content="MSHTML 6.00.2800.1264">
  6.     <META http-equiv="MSThemeCompatible" content="Yes">
  7.     <LINK href="MasterDetails.css" type="text/css" rel="stylesheet">
  8.     <OBJECT id="dsCustomersOrders" classid="clsid:A53ECD51-C062-4B08-97F0-4944CD7D88E7">
  9.         <PARAM name="XmlSchema" value="CustomersOrders.xsd">
  10.         <PARAM name="Xml" value="CustomersOrders.xml">
  11.     </OBJECT>
  12.     <OBJECT onrowenter="OnViewCustomersRowEnter();" id="viewCustomers"
  13.         classid="clsid:E3BC8FCA-E3F4-4B98-8627-9D3D343F9DA0">
  14.         <PARAM name="DataSetID" value="dsCustomersOrders">
  15.         <PARAM name="TableName" value="Customers">
  16.     </OBJECT>
  17.     <OBJECT id="viewOrders" classid="clsid:E3BC8FCA-E3F4-4B98-8627-9D3D343F9DA0"></OBJECT>
  18. <SCRIPT language="JScript">
  19. function viewCustomersMoveFirst()
  20. {
  21.     viewCustomers.recordset.MoveFirst()
  22. }
  23.  
  24. function viewCustomersMovePrevious()
  25. {
  26.     viewCustomers.recordset.MovePrevious();
  27.     if (viewCustomers.recordset.BOF)
  28.         viewCustomers.recordset.MoveFirst();
  29. }
  30.  
  31. function viewCustomersMoveNext()
  32. {
  33.     viewCustomers.recordset.MoveNext();
  34.     if (viewCustomers.recordset.EOF)
  35.         viewCustomers.recordset.MoveLast();
  36. }
  37.  
  38. function viewCustomersMoveLast()
  39. {
  40.     viewCustomers.recordset.MoveLast();
  41. }
  42.  
  43. function OnViewCustomersRowEnter()
  44. {
  45.     viewOrders.DataView = viewCustomers.CreateChildView(viewCustomers.recordset.AbsolutePosition,
  46.         "Customers2Orders");
  47. }
  48. </SCRIPT>
  49. </HEAD>
  50. <BODY>
  51.  
  52.     <H2>Customer:</H2>
  53.  
  54.     <DIV id="divNavigation">
  55.         <BUTTON id="btnFirst" onclick="viewCustomersMoveFirst()">< <</BUTTON>
  56.         <BUTTON id="btnPrev" onclick="viewCustomersMovePrevious()"><</BUTTON>
  57.         <BUTTON id="btnNext" onclick="viewCustomersMoveNext()">></BUTTON>
  58.         <BUTTON id="btnLast" onclick="viewCustomersMoveLast()">> ></BUTTON> 
  59.     </DIV>
  60.     <DIV id="divCustomer">
  61.         <TABLE id="tblCustomers" width="100%">
  62.             <TBODY>
  63.                 <TR>
  64.                     <TD class="tdHeader">Customer ID</TD>
  65.                     <TD><SPAN dataFld="CustomerID" dataSrc="#viewCustomers"></SPAN></TD>
  66.                     <TD class="tdHeader">Region</TD>
  67.                     <TD><SPAN dataFld="Region" dataSrc="#viewCustomers"></SPAN></TD>
  68.                 </TR>
  69.                 <TR>
  70.                     <TD class="tdHeader">Company Name</TD>
  71.                     <TD><SPAN dataFld="CompanyName" dataSrc="#viewCustomers"></SPAN></TD>
  72.                     <TD class="tdHeader">Postal Code</TD>
  73.                     <TD><SPAN dataFld="PostalCode" dataSrc="#viewCustomers"></SPAN></TD>
  74.                 </TR>
  75.                 <TR>
  76.                     <TD class="tdHeader">Contact Name</TD>
  77.                     <TD><SPAN dataFld="ContactName" dataSrc="#viewCustomers"></SPAN></TD>
  78.                     <TD class="tdHeader">Country</TD>
  79.                     <TD><SPAN dataFld="Country" dataSrc="#viewCustomers"></SPAN></TD>
  80.                 </TR>
  81.                 <TR>
  82.                     <TD class="tdHeader">Contact Title</TD>
  83.                     <TD><SPAN dataFld="ContactTitle" dataSrc="#viewCustomers"></SPAN></TD>
  84.                     <TD class="tdHeader">Phone</TD>
  85.                     <TD><SPAN dataFld="Phone" dataSrc="#viewCustomers"></SPAN></TD>
  86.                 </TR>
  87.                 <TR>
  88.                     <TD class="tdHeader">Address</TD>
  89.                     <TD><SPAN dataFld="Address" dataSrc="#viewCustomers"></SPAN></TD>
  90.                     <TD class="tdHeader">Fax</TD>
  91.                     <TD><SPAN dataFld="Fax" dataSrc="#viewCustomers"></SPAN></TD>
  92.                 </TR>
  93.                 <TR>
  94.                     <TD class="tdHeader">City</TD>
  95.                     <TD><SPAN dataFld="City" dataSrc="#viewCustomers"></SPAN></TD>
  96.                 </TR>
  97.             </TBODY>
  98.         </TABLE>
  99.     </DIV>
  100.  
  101.     <H2>Orders:</H2>
  102.  
  103.     <DIV id="divOrders">
  104.         <TABLE id="tblOrders" dataSrc="#viewOrders">
  105.             <THEAD>
  106.                 <TR>
  107.                     <TH>Order ID</TH>
  108.                     <TH>Customer ID</TH>
  109.                     <TH>Employee ID</TH>
  110.                     <TH>Order Date</TH>
  111.                     <TH>Required Date</TH>
  112.                     <TH>Shipped Date</TH>
  113.                     <TH>Ship Via</TH>
  114.                     <TH>Freight</TH>
  115.                 </TR>
  116.             </THEAD>
  117.             <TBODY>
  118.                 <TR>
  119.                     <TD><SPAN dataFld="OrderID"></SPAN></TD>
  120.                     <TD><SPAN dataFld="CustomerID"></SPAN></TD>
  121.                     <TD><SPAN dataFld="EmployeeID"></SPAN></TD>
  122.                     <TD><SPAN dataFld="OrderDate"></SPAN></TD>
  123.                     <TD><SPAN dataFld="RequiredDate"></SPAN></TD>
  124.                     <TD><SPAN dataFld="ShippedDate"></SPAN></TD>
  125.                     <TD><SPAN dataFld="ShipVia"></SPAN></TD>
  126.                     <TD><SPAN dataFld="Freight"></SPAN></TD>
  127.                 </TR>
  128.             </TBODY>
  129.         </TABLE>
  130.     </DIV>
  131.     <DIV id="divFooter">
  132.         <P id="creator">Created with <A href="http://www-sharp.com/" target="_blank"><STRONG>
  133.             www-Sharp</STRONG></A>.</P>
  134.     </DIV>
  135. </BODY>
  136. </HTML>
  137.